<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<TITLE>
FiniteDifferencesDifferentiator (Commons Math 3.2 API)
</TITLE>


<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../../stylesheet.css" TITLE="Style">

<SCRIPT type="text/javascript">
function windowTitle()
{
    if (location.href.indexOf('is-external=true') == -1) {
        parent.document.title="FiniteDifferencesDifferentiator (Commons Math 3.2 API)";
    }
}
</SCRIPT>
<NOSCRIPT>
</NOSCRIPT>

</HEAD>

<BODY BGCOLOR="white" onload="windowTitle();">
<HR>


<!-- ========= START OF TOP NAVBAR ======= -->
<A NAME="navbar_top"><!-- --></A>
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
  <TR ALIGN="center" VALIGN="top">
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/FiniteDifferencesDifferentiator.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
  </TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>

<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../../../../../org/apache/commons/math3/analysis/differentiation/DSCompiler.html" title="class in org.apache.commons.math3.analysis.differentiation"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../../../../../org/apache/commons/math3/analysis/differentiation/GradientFunction.html" title="class in org.apache.commons.math3.analysis.differentiation"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
  <A HREF="../../../../../../index.html?org/apache/commons/math3/analysis/differentiation/FiniteDifferencesDifferentiator.html" target="_top"><B>FRAMES</B></A>  &nbsp;
&nbsp;<A HREF="FiniteDifferencesDifferentiator.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
&nbsp;<SCRIPT type="text/javascript">
  <!--
  if(window==top) {
    document.writeln('<A HREF="../../../../../../allclasses-noframe.html"><B>All Classes</B></A>');
  }
  //-->
</SCRIPT>
<NOSCRIPT>
  <A HREF="../../../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>


</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
  SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
<!-- ========= END OF TOP NAVBAR ========= -->

<HR>
<!-- ======== START OF CLASS DATA ======== -->
<H2>
<FONT SIZE="-1">
org.apache.commons.math3.analysis.differentiation</FONT>
<BR>
Class FiniteDifferencesDifferentiator</H2>
<PRE>
<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</A>
  <IMG SRC="../../../../../../resources/inherit.gif" ALT="extended by "><B>org.apache.commons.math3.analysis.differentiation.FiniteDifferencesDifferentiator</B>
</PRE>
<DL>
<DT><B>All Implemented Interfaces:</B> <DD><A HREF="http://download.oracle.com/javase/6/docs/api/java/io/Serializable.html?is-external=true" title="class or interface in java.io">Serializable</A>, <A HREF="../../../../../../org/apache/commons/math3/analysis/differentiation/UnivariateFunctionDifferentiator.html" title="interface in org.apache.commons.math3.analysis.differentiation">UnivariateFunctionDifferentiator</A>, <A HREF="../../../../../../org/apache/commons/math3/analysis/differentiation/UnivariateMatrixFunctionDifferentiator.html" title="interface in org.apache.commons.math3.analysis.differentiation">UnivariateMatrixFunctionDifferentiator</A>, <A HREF="../../../../../../org/apache/commons/math3/analysis/differentiation/UnivariateVectorFunctionDifferentiator.html" title="interface in org.apache.commons.math3.analysis.differentiation">UnivariateVectorFunctionDifferentiator</A></DD>
</DL>
<HR>
<DL>
<DT><PRE>public class <B>FiniteDifferencesDifferentiator</B><DT>extends <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A><DT>implements <A HREF="../../../../../../org/apache/commons/math3/analysis/differentiation/UnivariateFunctionDifferentiator.html" title="interface in org.apache.commons.math3.analysis.differentiation">UnivariateFunctionDifferentiator</A>, <A HREF="../../../../../../org/apache/commons/math3/analysis/differentiation/UnivariateVectorFunctionDifferentiator.html" title="interface in org.apache.commons.math3.analysis.differentiation">UnivariateVectorFunctionDifferentiator</A>, <A HREF="../../../../../../org/apache/commons/math3/analysis/differentiation/UnivariateMatrixFunctionDifferentiator.html" title="interface in org.apache.commons.math3.analysis.differentiation">UnivariateMatrixFunctionDifferentiator</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/io/Serializable.html?is-external=true" title="class or interface in java.io">Serializable</A></DL>
</PRE>

<P>
Univariate functions differentiator using finite differences.
 <p>
 This class creates some wrapper objects around regular
 <A HREF="../../../../../../org/apache/commons/math3/analysis/UnivariateFunction.html" title="interface in org.apache.commons.math3.analysis"><CODE>univariate functions</CODE></A> (or <A HREF="../../../../../../org/apache/commons/math3/analysis/UnivariateVectorFunction.html" title="interface in org.apache.commons.math3.analysis"><CODE>univariate vector functions</CODE></A> or <A HREF="../../../../../../org/apache/commons/math3/analysis/UnivariateMatrixFunction.html" title="interface in org.apache.commons.math3.analysis"><CODE>univariate matrix functions</CODE></A>). These
 wrapper objects compute derivatives in addition to function
 value.
 </p>
 <p>
 The wrapper objects work by calling the underlying function on
 a sampling grid around the current point and performing polynomial
 interpolation. A finite differences scheme with n points is
 theoretically able to compute derivatives up to order n-1, but
 it is generally better to have a slight margin. The step size must
 also be small enough in order for the polynomial approximation to
 be good in the current point neighborhood, but it should not be too
 small because numerical instability appears quickly (there are several
 differences of close points). Choosing the number of points and
 the step size is highly problem dependent.
 </p>
 <p>
 As an example of good and bad settings, lets consider the quintic
 polynomial function <code>f(x) = (x-1)*(x-0.5)*x*(x+0.5)*(x+1)</code>.
 Since it is a polynomial, finite differences with at least 6 points
 should theoretically recover the exact same polynomial and hence
 compute accurate derivatives for any order. However, due to numerical
 errors, we get the following results for a 7 points finite differences
 for abscissae in the [-10, 10] range:
 <ul>
   <li>step size = 0.25, second order derivative error about 9.97e-10</li>
   <li>step size = 0.25, fourth order derivative error about 5.43e-8</li>
   <li>step size = 1.0e-6, second order derivative error about 148</li>
   <li>step size = 1.0e-6, fourth order derivative error about 6.35e+14</li>
 </ul>
 This example shows that the small step size is really bad, even simply
 for second order derivative!
 </p>
<P>

<P>
<DL>
<DT><B>Since:</B></DT>
  <DD>3.1</DD>
<DT><B>Version:</B></DT>
  <DD>$Id: FiniteDifferencesDifferentiator.java 1420666 2012-12-12 13:33:20Z erans $</DD>
<DT><B>See Also:</B><DD><A HREF="../../../../../../serialized-form.html#org.apache.commons.math3.analysis.differentiation.FiniteDifferencesDifferentiator">Serialized Form</A></DL>
<HR>

<P>

<!-- ======== CONSTRUCTOR SUMMARY ======== -->

<A NAME="constructor_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Constructor Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../../../../../org/apache/commons/math3/analysis/differentiation/FiniteDifferencesDifferentiator.html#FiniteDifferencesDifferentiator(int, double)">FiniteDifferencesDifferentiator</A></B>(int&nbsp;nbPoints,
                                double&nbsp;stepSize)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Build a differentiator with number of points and step size when independent variable is unbounded.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../../../../../org/apache/commons/math3/analysis/differentiation/FiniteDifferencesDifferentiator.html#FiniteDifferencesDifferentiator(int, double, double, double)">FiniteDifferencesDifferentiator</A></B>(int&nbsp;nbPoints,
                                double&nbsp;stepSize,
                                double&nbsp;tLower,
                                double&nbsp;tUpper)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Build a differentiator with number of points and step size when independent variable is bounded.</TD>
</TR>
</TABLE>
&nbsp;
<!-- ========== METHOD SUMMARY =========== -->

<A NAME="method_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Method Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="../../../../../../org/apache/commons/math3/analysis/differentiation/UnivariateDifferentiableFunction.html" title="interface in org.apache.commons.math3.analysis.differentiation">UnivariateDifferentiableFunction</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../org/apache/commons/math3/analysis/differentiation/FiniteDifferencesDifferentiator.html#differentiate(org.apache.commons.math3.analysis.UnivariateFunction)">differentiate</A></B>(<A HREF="../../../../../../org/apache/commons/math3/analysis/UnivariateFunction.html" title="interface in org.apache.commons.math3.analysis">UnivariateFunction</A>&nbsp;function)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Create an implementation of a <A HREF="../../../../../../org/apache/commons/math3/analysis/differentiation/UnivariateDifferentiableFunction.html" title="interface in org.apache.commons.math3.analysis.differentiation"><CODE>differential</CODE></A> from a regular <A HREF="../../../../../../org/apache/commons/math3/analysis/UnivariateFunction.html" title="interface in org.apache.commons.math3.analysis"><CODE>function</CODE></A>.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="../../../../../../org/apache/commons/math3/analysis/differentiation/UnivariateDifferentiableMatrixFunction.html" title="interface in org.apache.commons.math3.analysis.differentiation">UnivariateDifferentiableMatrixFunction</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../org/apache/commons/math3/analysis/differentiation/FiniteDifferencesDifferentiator.html#differentiate(org.apache.commons.math3.analysis.UnivariateMatrixFunction)">differentiate</A></B>(<A HREF="../../../../../../org/apache/commons/math3/analysis/UnivariateMatrixFunction.html" title="interface in org.apache.commons.math3.analysis">UnivariateMatrixFunction</A>&nbsp;function)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Create an implementation of a <A HREF="../../../../../../org/apache/commons/math3/analysis/differentiation/UnivariateDifferentiableMatrixFunction.html" title="interface in org.apache.commons.math3.analysis.differentiation"><CODE>differential</CODE></A> from a regular <A HREF="../../../../../../org/apache/commons/math3/analysis/UnivariateMatrixFunction.html" title="interface in org.apache.commons.math3.analysis"><CODE>matrix function</CODE></A>.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="../../../../../../org/apache/commons/math3/analysis/differentiation/UnivariateDifferentiableVectorFunction.html" title="interface in org.apache.commons.math3.analysis.differentiation">UnivariateDifferentiableVectorFunction</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../org/apache/commons/math3/analysis/differentiation/FiniteDifferencesDifferentiator.html#differentiate(org.apache.commons.math3.analysis.UnivariateVectorFunction)">differentiate</A></B>(<A HREF="../../../../../../org/apache/commons/math3/analysis/UnivariateVectorFunction.html" title="interface in org.apache.commons.math3.analysis">UnivariateVectorFunction</A>&nbsp;function)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Create an implementation of a <A HREF="../../../../../../org/apache/commons/math3/analysis/differentiation/UnivariateDifferentiableVectorFunction.html" title="interface in org.apache.commons.math3.analysis.differentiation"><CODE>differential</CODE></A> from a regular <A HREF="../../../../../../org/apache/commons/math3/analysis/UnivariateVectorFunction.html" title="interface in org.apache.commons.math3.analysis"><CODE>vector function</CODE></A>.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../org/apache/commons/math3/analysis/differentiation/FiniteDifferencesDifferentiator.html#getNbPoints()">getNbPoints</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Get the number of points to use.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;double</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../org/apache/commons/math3/analysis/differentiation/FiniteDifferencesDifferentiator.html#getStepSize()">getStepSize</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Get the step size.</TD>
</TR>
</TABLE>
&nbsp;<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left"><B>Methods inherited from class java.lang.<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A></B></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#clone()" title="class or interface in java.lang">clone</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#equals(java.lang.Object)" title="class or interface in java.lang">equals</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#finalize()" title="class or interface in java.lang">finalize</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#getClass()" title="class or interface in java.lang">getClass</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#hashCode()" title="class or interface in java.lang">hashCode</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#notify()" title="class or interface in java.lang">notify</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#notifyAll()" title="class or interface in java.lang">notifyAll</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#toString()" title="class or interface in java.lang">toString</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait()" title="class or interface in java.lang">wait</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait(long)" title="class or interface in java.lang">wait</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait(long, int)" title="class or interface in java.lang">wait</A></CODE></TD>
</TR>
</TABLE>
&nbsp;
<P>

<!-- ========= CONSTRUCTOR DETAIL ======== -->

<A NAME="constructor_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Constructor Detail</B></FONT></TH>
</TR>
</TABLE>

<A NAME="FiniteDifferencesDifferentiator(int, double)"><!-- --></A><H3>
FiniteDifferencesDifferentiator</H3>
<PRE>
public <B>FiniteDifferencesDifferentiator</B>(int&nbsp;nbPoints,
                                       double&nbsp;stepSize)
                                throws <A HREF="../../../../../../org/apache/commons/math3/exception/NotPositiveException.html" title="class in org.apache.commons.math3.exception">NotPositiveException</A>,
                                       <A HREF="../../../../../../org/apache/commons/math3/exception/NumberIsTooSmallException.html" title="class in org.apache.commons.math3.exception">NumberIsTooSmallException</A></PRE>
<DL>
<DD>Build a differentiator with number of points and step size when independent variable is unbounded.
 <p>
 Beware that wrong settings for the finite differences differentiator
 can lead to highly unstable and inaccurate results, especially for
 high derivation orders. Using very small step sizes is often a
 <em>bad</em> idea.
 </p>
<P>
<DL>
<DT><B>Parameters:</B><DD><CODE>nbPoints</CODE> - number of points to use<DD><CODE>stepSize</CODE> - step size (gap between each point)
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../../../../../org/apache/commons/math3/exception/NotPositiveException.html" title="class in org.apache.commons.math3.exception">NotPositiveException</A></CODE> - if <code>stepsize &lt;= 0</code> (note that
 <A HREF="../../../../../../org/apache/commons/math3/exception/NotPositiveException.html" title="class in org.apache.commons.math3.exception"><CODE>NotPositiveException</CODE></A> extends <A HREF="../../../../../../org/apache/commons/math3/exception/NumberIsTooSmallException.html" title="class in org.apache.commons.math3.exception"><CODE>NumberIsTooSmallException</CODE></A>)
<DD><CODE><A HREF="../../../../../../org/apache/commons/math3/exception/NumberIsTooSmallException.html" title="class in org.apache.commons.math3.exception">NumberIsTooSmallException</A></CODE> - <code>nbPoint &lt;= 1</code></DL>
</DL>
<HR>

<A NAME="FiniteDifferencesDifferentiator(int, double, double, double)"><!-- --></A><H3>
FiniteDifferencesDifferentiator</H3>
<PRE>
public <B>FiniteDifferencesDifferentiator</B>(int&nbsp;nbPoints,
                                       double&nbsp;stepSize,
                                       double&nbsp;tLower,
                                       double&nbsp;tUpper)
                                throws <A HREF="../../../../../../org/apache/commons/math3/exception/NotPositiveException.html" title="class in org.apache.commons.math3.exception">NotPositiveException</A>,
                                       <A HREF="../../../../../../org/apache/commons/math3/exception/NumberIsTooSmallException.html" title="class in org.apache.commons.math3.exception">NumberIsTooSmallException</A>,
                                       <A HREF="../../../../../../org/apache/commons/math3/exception/NumberIsTooLargeException.html" title="class in org.apache.commons.math3.exception">NumberIsTooLargeException</A></PRE>
<DL>
<DD>Build a differentiator with number of points and step size when independent variable is bounded.
 <p>
 When the independent variable is bounded (tLower &lt; t &lt; tUpper), the sampling
 points used for differentiation will be adapted to ensure the constraint holds
 even near the boundaries. This means the sample will not be centered anymore in
 these cases. At an extreme case, computing derivatives exactly at the lower bound
 will lead the sample to be entirely on the right side of the derivation point.
 </p>
 <p>
 Note that the boundaries are considered to be excluded for function evaluation.
 </p>
 <p>
 Beware that wrong settings for the finite differences differentiator
 can lead to highly unstable and inaccurate results, especially for
 high derivation orders. Using very small step sizes is often a
 <em>bad</em> idea.
 </p>
<P>
<DL>
<DT><B>Parameters:</B><DD><CODE>nbPoints</CODE> - number of points to use<DD><CODE>stepSize</CODE> - step size (gap between each point)<DD><CODE>tLower</CODE> - lower bound for independent variable (may be <code>Double.NEGATIVE_INFINITY</code>
 if there are no lower bounds)<DD><CODE>tUpper</CODE> - upper bound for independent variable (may be <code>Double.POSITIVE_INFINITY</code>
 if there are no upper bounds)
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../../../../../org/apache/commons/math3/exception/NotPositiveException.html" title="class in org.apache.commons.math3.exception">NotPositiveException</A></CODE> - if <code>stepsize &lt;= 0</code> (note that
 <A HREF="../../../../../../org/apache/commons/math3/exception/NotPositiveException.html" title="class in org.apache.commons.math3.exception"><CODE>NotPositiveException</CODE></A> extends <A HREF="../../../../../../org/apache/commons/math3/exception/NumberIsTooSmallException.html" title="class in org.apache.commons.math3.exception"><CODE>NumberIsTooSmallException</CODE></A>)
<DD><CODE><A HREF="../../../../../../org/apache/commons/math3/exception/NumberIsTooSmallException.html" title="class in org.apache.commons.math3.exception">NumberIsTooSmallException</A></CODE> - <code>nbPoint &lt;= 1</code>
<DD><CODE><A HREF="../../../../../../org/apache/commons/math3/exception/NumberIsTooLargeException.html" title="class in org.apache.commons.math3.exception">NumberIsTooLargeException</A></CODE> - <code>stepSize * (nbPoints - 1) &gt;= tUpper - tLower</code></DL>
</DL>

<!-- ============ METHOD DETAIL ========== -->

<A NAME="method_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Method Detail</B></FONT></TH>
</TR>
</TABLE>

<A NAME="getNbPoints()"><!-- --></A><H3>
getNbPoints</H3>
<PRE>
public int <B>getNbPoints</B>()</PRE>
<DL>
<DD>Get the number of points to use.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>

<DT><B>Returns:</B><DD>number of points to use</DL>
</DD>
</DL>
<HR>

<A NAME="getStepSize()"><!-- --></A><H3>
getStepSize</H3>
<PRE>
public double <B>getStepSize</B>()</PRE>
<DL>
<DD>Get the step size.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>

<DT><B>Returns:</B><DD>step size</DL>
</DD>
</DL>
<HR>

<A NAME="differentiate(org.apache.commons.math3.analysis.UnivariateFunction)"><!-- --></A><H3>
differentiate</H3>
<PRE>
public <A HREF="../../../../../../org/apache/commons/math3/analysis/differentiation/UnivariateDifferentiableFunction.html" title="interface in org.apache.commons.math3.analysis.differentiation">UnivariateDifferentiableFunction</A> <B>differentiate</B>(<A HREF="../../../../../../org/apache/commons/math3/analysis/UnivariateFunction.html" title="interface in org.apache.commons.math3.analysis">UnivariateFunction</A>&nbsp;function)</PRE>
<DL>
<DD>Create an implementation of a <A HREF="../../../../../../org/apache/commons/math3/analysis/differentiation/UnivariateDifferentiableFunction.html" title="interface in org.apache.commons.math3.analysis.differentiation"><CODE>differential</CODE></A> from a regular <A HREF="../../../../../../org/apache/commons/math3/analysis/UnivariateFunction.html" title="interface in org.apache.commons.math3.analysis"><CODE>function</CODE></A>.
 <p>The returned object cannot compute derivatives to arbitrary orders. The
 value function will throw a <A HREF="../../../../../../org/apache/commons/math3/exception/NumberIsTooLargeException.html" title="class in org.apache.commons.math3.exception"><CODE>NumberIsTooLargeException</CODE></A> if the requested
 derivation order is larger or equal to the number of points.
 </p>
<P>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE><A HREF="../../../../../../org/apache/commons/math3/analysis/differentiation/UnivariateFunctionDifferentiator.html#differentiate(org.apache.commons.math3.analysis.UnivariateFunction)">differentiate</A></CODE> in interface <CODE><A HREF="../../../../../../org/apache/commons/math3/analysis/differentiation/UnivariateFunctionDifferentiator.html" title="interface in org.apache.commons.math3.analysis.differentiation">UnivariateFunctionDifferentiator</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>function</CODE> - function to differentiate
<DT><B>Returns:</B><DD>differential function</DL>
</DD>
</DL>
<HR>

<A NAME="differentiate(org.apache.commons.math3.analysis.UnivariateVectorFunction)"><!-- --></A><H3>
differentiate</H3>
<PRE>
public <A HREF="../../../../../../org/apache/commons/math3/analysis/differentiation/UnivariateDifferentiableVectorFunction.html" title="interface in org.apache.commons.math3.analysis.differentiation">UnivariateDifferentiableVectorFunction</A> <B>differentiate</B>(<A HREF="../../../../../../org/apache/commons/math3/analysis/UnivariateVectorFunction.html" title="interface in org.apache.commons.math3.analysis">UnivariateVectorFunction</A>&nbsp;function)</PRE>
<DL>
<DD>Create an implementation of a <A HREF="../../../../../../org/apache/commons/math3/analysis/differentiation/UnivariateDifferentiableVectorFunction.html" title="interface in org.apache.commons.math3.analysis.differentiation"><CODE>differential</CODE></A> from a regular <A HREF="../../../../../../org/apache/commons/math3/analysis/UnivariateVectorFunction.html" title="interface in org.apache.commons.math3.analysis"><CODE>vector function</CODE></A>.
 <p>The returned object cannot compute derivatives to arbitrary orders. The
 value function will throw a <A HREF="../../../../../../org/apache/commons/math3/exception/NumberIsTooLargeException.html" title="class in org.apache.commons.math3.exception"><CODE>NumberIsTooLargeException</CODE></A> if the requested
 derivation order is larger or equal to the number of points.
 </p>
<P>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE><A HREF="../../../../../../org/apache/commons/math3/analysis/differentiation/UnivariateVectorFunctionDifferentiator.html#differentiate(org.apache.commons.math3.analysis.UnivariateVectorFunction)">differentiate</A></CODE> in interface <CODE><A HREF="../../../../../../org/apache/commons/math3/analysis/differentiation/UnivariateVectorFunctionDifferentiator.html" title="interface in org.apache.commons.math3.analysis.differentiation">UnivariateVectorFunctionDifferentiator</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>function</CODE> - function to differentiate
<DT><B>Returns:</B><DD>differential function</DL>
</DD>
</DL>
<HR>

<A NAME="differentiate(org.apache.commons.math3.analysis.UnivariateMatrixFunction)"><!-- --></A><H3>
differentiate</H3>
<PRE>
public <A HREF="../../../../../../org/apache/commons/math3/analysis/differentiation/UnivariateDifferentiableMatrixFunction.html" title="interface in org.apache.commons.math3.analysis.differentiation">UnivariateDifferentiableMatrixFunction</A> <B>differentiate</B>(<A HREF="../../../../../../org/apache/commons/math3/analysis/UnivariateMatrixFunction.html" title="interface in org.apache.commons.math3.analysis">UnivariateMatrixFunction</A>&nbsp;function)</PRE>
<DL>
<DD>Create an implementation of a <A HREF="../../../../../../org/apache/commons/math3/analysis/differentiation/UnivariateDifferentiableMatrixFunction.html" title="interface in org.apache.commons.math3.analysis.differentiation"><CODE>differential</CODE></A> from a regular <A HREF="../../../../../../org/apache/commons/math3/analysis/UnivariateMatrixFunction.html" title="interface in org.apache.commons.math3.analysis"><CODE>matrix function</CODE></A>.
 <p>The returned object cannot compute derivatives to arbitrary orders. The
 value function will throw a <A HREF="../../../../../../org/apache/commons/math3/exception/NumberIsTooLargeException.html" title="class in org.apache.commons.math3.exception"><CODE>NumberIsTooLargeException</CODE></A> if the requested
 derivation order is larger or equal to the number of points.
 </p>
<P>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE><A HREF="../../../../../../org/apache/commons/math3/analysis/differentiation/UnivariateMatrixFunctionDifferentiator.html#differentiate(org.apache.commons.math3.analysis.UnivariateMatrixFunction)">differentiate</A></CODE> in interface <CODE><A HREF="../../../../../../org/apache/commons/math3/analysis/differentiation/UnivariateMatrixFunctionDifferentiator.html" title="interface in org.apache.commons.math3.analysis.differentiation">UnivariateMatrixFunctionDifferentiator</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>function</CODE> - function to differentiate
<DT><B>Returns:</B><DD>differential function</DL>
</DD>
</DL>
<!-- ========= END OF CLASS DATA ========= -->
<HR>


<!-- ======= START OF BOTTOM NAVBAR ====== -->
<A NAME="navbar_bottom"><!-- --></A>
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
  <TR ALIGN="center" VALIGN="top">
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/FiniteDifferencesDifferentiator.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
  </TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>

<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../../../../../org/apache/commons/math3/analysis/differentiation/DSCompiler.html" title="class in org.apache.commons.math3.analysis.differentiation"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../../../../../org/apache/commons/math3/analysis/differentiation/GradientFunction.html" title="class in org.apache.commons.math3.analysis.differentiation"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
  <A HREF="../../../../../../index.html?org/apache/commons/math3/analysis/differentiation/FiniteDifferencesDifferentiator.html" target="_top"><B>FRAMES</B></A>  &nbsp;
&nbsp;<A HREF="FiniteDifferencesDifferentiator.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
&nbsp;<SCRIPT type="text/javascript">
  <!--
  if(window==top) {
    document.writeln('<A HREF="../../../../../../allclasses-noframe.html"><B>All Classes</B></A>');
  }
  //-->
</SCRIPT>
<NOSCRIPT>
  <A HREF="../../../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>


</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
  SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= -->

<HR>
Copyright &#169; 2003-2013 <a href="http://www.apache.org/">The Apache Software Foundation</a>. All Rights Reserved.
</BODY>
</HTML>
